package com.buba.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.buba.mapper.SalaryitemsMapper;
import com.buba.service.SalaryitemsService;
import entity.salary.Salaryitems;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author beisheng
 * @since 2023-03-22
 */
@Service
public class SalaryitemsServiceImpl extends ServiceImpl<SalaryitemsMapper, Salaryitems> implements SalaryitemsService {

    @Resource
    private SalaryitemsMapper salaryitemsMapper;

    /* *
     * @Author: beisheng
     * @Descriprion: 根据工资单ID删除所有关联工资单薪资项
     * @Date: 2023/3/22 20:23
     * @Return: common.R
     * @Param: [paId]
     */

    @Override
    public void deleteSalaryFile(Integer paId) {
        Salaryitems salaryitems = new Salaryitems();
        salaryitems.setDeleteFlag(1);
        salaryitemsMapper.update(salaryitems,new QueryWrapper<Salaryitems>().eq("pa_id",paId));
    }
}
